<div class="eject_con">
  <div id="warning" class="alert alert-error"></div>
  <form id="category_form" method="post" target="_parent" action="{:url('seller/album/modify')}">
      <input type="hidden" name="id" value="{$item.aclass_id ?? '0'}" />
    <dl>
      <dt><i class="required">*</i>相册名称：</dt>
      <dd>
        <input class="w300 text" type="text" name="name" id="name" value="{$item.aclass_name ?? ''}" />
      </dd>
    </dl>
    <dl>
      <dt>描述：</dt>
      <dd>
        <textarea class="w300 textarea" rows="3" name="description" id="description">{$item.aclass_des ?? ''}</textarea>
      </dd>
    </dl>
    <dl>
      <dt>排序：</dt>
      <dd>
        <input class="w50 text" type="text" name="sort" id="sort" value="{$item.aclass_sort ?? ''}" />
      </dd>
    </dl>
    <div class="bottom">
      <label class="submit-border">
        <input type="submit" class="submit" value="提交" />
      </label>
    </div>
  </form>
</div>
<script type="text/javascript">
$(function(){
    $('#category_form').validate({
        errorLabelContainer: $('#warning'),
        invalidHandler: function(form, validator) {
               $('#warning').show();
        },
    	submitHandler:function(form){
    		ajaxpost('category_form', '', '', 'onerror') 
    	},
        rules : {
        	name : {
                required : true,
                maxlength	: 20
            },
            description : {
            	maxlength	: 100
            },
            sort : {
            	digits   : true
            }
        },
        messages : {
        	name : {
                required : '<i class="icon-exclamation-sign"></i>相册名称不能为空',
                maxlength	: '<i class="icon-exclamation-sign"></i>相册名称不能超过20个字符',
                remote		: '<i class="icon-exclamation-sign"></i>相册名称已存在'
            },
            description : {
            	maxlength	: '<i class="icon-exclamation-sign"></i>描述不能超过100个字符'
            },
            sort  : {
            	digits   : '<i class="icon-exclamation-sign"></i>排序只能填写数字'
            }
        }
    });
});
</script> 
